package com.unicloud.medical.oss.common.model.request;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class SignedUrlRequest extends CommonRequest {
    /**
     * 桶名称
     */
    private String bucketName;

    /**
     * 对象名称
     */
    String objectName;

    public void setBucketName(String bucketName) {
        this.bucketName = StringUtils.trimToNull(bucketName);
    }

    public void setObjectName(String objectName) {
        this.objectName = StringUtils.trimToNull(objectName);
    }

    @Override
    public String toString() {
        return "{"
                + "\"ossName\":\""
                + ossName + '\"'
                + ",\"bucketName\":\""
                + bucketName + '\"'
                + ",\"objectName\":\""
                + objectName + '\"'
                + "}";
    }
}
